

//#include <iostream>
//using namespace std;
//class Soldier
//{
//public:
//	Soldier(int hp = 100, int atk = 10) :_hp(hp), _atk(atk) {
//		++_SoldierCount;
//	}
//	Soldier(const Soldier& S) :_hp(S._hp), _atk(S._atk) {
//		++_SoldierCount;
//	}
//	~Soldier() { --_SoldierCount; }
//	int getAtk() { return _atk + _SoldierCount / 10; }
//private:
//	int _hp, _atk;
//	static int _SoldierCount;
//};
//int Soldier::_SoldierCount = 0;
//int main()
//{
//	Soldier s[18];
//	cout << s->getAtk() << endl;
//	Soldier* p = new Soldier[2];
//	cout << s->getAtk() << endl;
//	delete[] p;
//	cout << s->getAtk() << endl;
//	return 0;
//}


//#include <iostream>
//using namespace std;
//class Max
//{
//public:
//	int max(int a, int b) { return (a > b) ? a : b; }
//	int max(int a, int b, int c){
//		int tmp = max(a, b);
//		return max(tmp, c);
//	}
//	int max(int a, int b, int c, int d) {
//		int tmp = max(a, b, c);
//		return max(tmp, d);
//	}
//};
//int main()
//{
//	int a = 10, b = 20, c = 30, d = 40;
//	Max obj;
//	cout << obj.max(a, c, b, d);
//	return 0;
//}


//#include <iostream>
//using namespace std;
//class Clock
//{
//public:
//	friend ostream& operator<<(ostream& out, const Clock& clock);
//	Clock(int _hour = 0, int _minute = 0, int _second = 0)
//		:hour(_hour), minute(_minute), second(_second) {}
//	Clock& operator++() {
//		++(this->second);
//		if (this->second >= 60) {
//			this->minute += this->second / 60;
//			this->second %= 60;
//		}
//		if (this->minute >= 60) {
//			this->hour += this->minute / 60;
//			this->minute %= 60;
//		}
//		hour %= 24;
//		return *this;
//	}
//	Clock operator++(int) {
//		Clock tmp(*this);
//		++(*this);
//		return tmp;
//	}
//private:
//	int hour, minute, second;
//};
//ostream& operator<<(ostream& out, const Clock& clock)
//{
//	out << clock.hour << ":" << clock.minute << ":" << clock.second << endl;
//	return out;
//}
//int main()
//{
//	Clock c(23, 59, 59);
//	cout << ++c << c++++ << ++++c;
//	return 0;
//}


//#include <iostream>
//using namespace std;
//class Shape
//{
//public:
//	Shape() {}
//	virtual float getArea() const = 0;
//	virtual ~Shape() {}
//};
//class Rectangle :public Shape
//{
//public:
//	Rectangle(float Length = 1.0f, float Width = 2.0f)
//		:length(Length), width(Width) {}
//	float getArea() const { return length * width; }
//private:
//	float length, width;
//};
//class Circle :public Shape
//{
//public:
//	Circle(float Radius = 1.0f) :radius(Radius) {}
//	float getArea() const { return radius * radius * 3.14f; }
//private:
//	float radius;
//};
//float getTotalArea(Shape* S[], int N)
//{
//	float Total = 0.0f;
//	for (int i = 0; i < N; ++i)
//		Total += S[i]->getArea();
//	return Total;
//}
//int main()
//{
//	Shape* S[4];
//	Rectangle s1(1, 2), s0(3, 4);
//	Circle s2(1), s3(2);
//	S[0] = &s0;
//	S[1] = &s1;
//	S[2] = &s2;
//	S[3] = &s3;
//	cout << getTotalArea(S, 4);
//	return 0;
//}


//#include <iostream>
//using namespace std;
//class Point
//{
//public:
//	Point() { x = 0.0f, y = 0.0f; }
//	Point(float X, float Y) :x(X), y(Y) {}
//	Point(const Point& p) :x(p.x), y(p.y) {}
//	void moveTo(Point DestP) { x = DestP.x, y = DestP.y; }
//private:
//	float x, y;
//};
//class Circle
//{
//public:
//	Circle() { radius = 1.0f; }
//	Circle(float X, float Y, float Radius)
//		:center(X, Y), radius(Radius) {}
//	void moveTo(Point DestP) { center.moveTo(DestP); }
//private:
//	Point center;
//	float radius;
//};
//int main()
//{
//	return 0;
//}


#include <iostream>
using namespace std;

class A
{
public:
	int x;
	A() :x(1) {}
	A(int X) :x(X) {}
};

class B1 :virtual public A
{
public:
	B1() :A(), y1(2) {}
	B1(int X, int Y1) :A(X), y1(Y1) {}
private:
	int y1;
};

class B2 :virtual public A
{
public:
	B2() :A(), y2(3) {}
	B2(int X, int Y2) :A(X), y2(Y2) {}
private:
	int y2;
};

class C :public B1, public B2
{
public:
	C() :A(), B1(), B2(), z(4) {}
	C(int X, int Y1, int Y2, int Z) :A(X), B1(X, Y1), B2(X, Y2), z(Z) {}
private:
	int z;
};

int main()
{
	C c;
	c.x = 10;
	cout << c.x;
	return 0;
}